package com.spzx.product.api;

import com.spzx.common.core.constant.SecurityConstants;
import com.spzx.common.core.constant.ServiceNameConstants;
import com.spzx.common.core.domain.R;
import com.spzx.common.core.web.page.TableDataInfo;
import com.spzx.product.api.domain.ProductSku;
import com.spzx.product.api.domain.SkuQuery;
import com.spzx.product.api.domain.vo.CategoryVo;
import com.spzx.product.api.domain.vo.ProductSkuVo;
import com.spzx.product.api.factory.RemoteCategoryFallbackFactory;
import com.spzx.product.api.factory.RemoteProductSkuFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;

@FeignClient(contextId = "remoteProductSkuService",
        value = ServiceNameConstants.PRODUCT_SERVICE,
        fallbackFactory = RemoteProductSkuFallbackFactory.class
)
public interface RemoteProductSkuService {
    @GetMapping("/productSku/getTopSale")
    R<List<ProductSku>> getTopSale(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("/productSku/getProductSkuList/{pageNum}/{pageSize}")
    TableDataInfo getProductSkuList(@PathVariable("pageNum") Integer pageNum,
                                    @PathVariable("pageSize") Integer pageSize,
                                    @RequestHeader(SecurityConstants.FROM_SOURCE) String source,
                                    @SpringQueryMap SkuQuery skuQuery);
}